#include "wxsscrolledwindow.h"

namespace {
  wxsRegisterItem<wxsScrolledWindow> Reg( _T( "ScrolledWindow" ), _T( "滚动窗口" ), wxsTContainer, _T( "标准" ), 140 );
  WXS_ST_BEGIN( wxsScrolledWindowStyles, _T( "wxHSCROLL|wxVSCROLL" ) )
  WXS_ST_CATEGORY( "wxScrolledWindow" )
  WXS_ST_DEFAULTS()
  WXS_ST_END()
  WXS_EV_BEGIN( wxsScrolledWindowEvents )
  WXS_EV_DEFAULTS()
  WXS_EV_END()
}

wxsScrolledWindow::wxsScrolledWindow( wxsItemResData* Data ):
  wxsContainer(
    Data,
    &Reg.Info,
    wxsScrolledWindowEvents,
    wxsScrolledWindowStyles ) {}

void wxsScrolledWindow::OnBuildCreatingCode() {
  switch( GetLanguage() ) {
    case wxsCPP: {
      AddHeader( _T( "<wx/scrolwin.h>" ), GetInfo().ClassName, hfInPCH );
      Codef( _T( "%C(%W, %I, %P, %S, %T, %N);\n" ) );
      BuildSetupWindowCode();
      AddChildrenCode();
      return;
    }
    case wxsUnknownLanguage:
    default: {
      wxsCodeMarks::Unknown( _T( "wxsScrolledWindow::OnBuildCreatingCode" ), GetLanguage() );
    }
  }
}

wxObject* wxsScrolledWindow::OnBuildPreview( wxWindow* Parent, long Flags ) {
  wxWindow* NewItem = new wxScrolledWindow( Parent, GetId(), wxDefaultPosition, wxDefaultSize, Style() );
  SetupWindow( NewItem, Flags );
  AddChildrenPreview( NewItem, Flags );
  return NewItem;
}

void wxsScrolledWindow::OnEnumContainerProperties( M_Code_unused long Flags ) {
}
